IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[InsertCocina]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[InsertCocina]
GO

CREATE PROCEDURE [dbo].[InsertCocina]
(
	@cocinaID int OUT,
	@fecha datetime,
	@personalID smallint,
	@loteID int,
	@almacenID smallint,
	@cantidad float(53),
	@estado char(1)
)
AS
BEGIN
	SET NOCOUNT ON

	INSERT INTO [Cocina] ([fecha], [personalID], [loteID], [almacenID], [cantidad], [estado]) 
	VALUES (@fecha, @personalID, @loteID, @almacenID, @cantidad, @estado)

	SET @cocinaID = SCOPE_IDENTITY()

	SET NOCOUNT OFF
END

GO
